def get_table_define_sql(database_type, source):
    """ 得到表定义的函数 """
    v_sql = ""
    if database_type == 'openGauss' or database_type == 'gaussdb':
        v_sql = """
        select ''""" + source + """'' as source
              ,schemaname as schema
              ,tableowner as owner
              ,tablename as table_name
              ,regexp_replace(pg_get_tabledef(schemaname || ''.'' || tablename)::text,E''\\x1F'','''', ''g'') 
                 as table_define
              ,tablecreator as table_creator
              ,to_char(created,''yyyy-mm-dd hh24:mi:ss'') as created
              ,to_char(last_ddl_time,''yyyy-mm-dd hh24:mi:ss'') as last_ddl_time
          from pg_tables
         where schemaname !~* ''pg_catalog|dbe_pldeveloper|information_schema|db4ai|adms_checkpoint''
           and tableowner !~* ''pg_catalog|dbe_pldeveloper|information_schema|db4ai|adms_checkpoint''
        """
    elif database_type == 'PostgreSQL':
        v_sql = """
        """
    else:
        print("table_define_sql.py -- 未知的数据库类型！")
    return v_sql
